﻿<PropertyPanels:GadgetPropertiesPanelBase x:Class="EpiDashboard.Controls.GadgetProperties.PieChartProperties"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:Controls="clr-namespace:EpiDashboard.Controls"
             xmlns:PropertyPanels="clr-namespace:EpiDashboard.Controls.GadgetProperties"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800" Loaded="UserControl_Loaded" Style="{DynamicResource PropertiesPanelStyle}">
    <PropertyPanels:GadgetPropertiesPanelBase.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../StyleDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </PropertyPanels:GadgetPropertiesPanelBase.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="400" Width=".33*" />
            <ColumnDefinition Width="30" />
            <ColumnDefinition Width=".66*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Grid.Column="0" Grid.RowSpan="3" x:Name="panelSidebar" Background="{StaticResource PrimaryAccentColorLight}">
            <Label x:Name="lblConfigExpandedTitle" FontWeight="Light" Foreground="White" FontSize="56" Margin="0, 0, 0, 10">Pie Chart</Label>

            <Controls:SettingsToggleButton x:Name="tbtnVariables" Title="Variables" Description="Select the variables for the column chart." IsChecked="True" Checked="tbtnVariables_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnDisplay" Title="Display" Description="Change display options." IsChecked="False" Checked="tbtnDisplay_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnDisplayColors" Title="Colors and Styles" Description="Set chart colors and styles." IsChecked="False" Checked="tbtnDisplayColors_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnDisplayLabels" Title="Labels" Description="Customize chart labels." IsChecked="False" Checked="tbtnDisplayLabels_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnDisplayLegend" Title="Legend" Description="Set legend options." IsChecked="False" Checked="tbtnDisplayLegend_Checked"/>
            <Controls:SettingsToggleButton x:Name="tbtnFilters" Title="Filters" Description="Set data filters for this gadget." IsChecked="False" Checked="tbtnFilters_Checked"/>

        </StackPanel>
<!--Variables-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->

        <StackPanel x:Name="panelVariables" Grid.Column="2" Margin="0, 0, 10, 0" Visibility="Visible">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Variables</Label>

            <TextBlock x:Name="tblockMainVariable">Main variable:</TextBlock>
            <ComboBox x:Name="cmbField" Width="216" HorizontalAlignment="Left" Height="28" SelectionChanged="cmbField_SelectionChanged" />
            

            <TextBlock x:Name="tblockWeightVariable" Margin="0,12,0,0">Weight:</TextBlock>
            <ComboBox x:Name="cmbFieldWeight" Width="216" HorizontalAlignment="Left" Height="28" SelectionChanged="cmbFieldWeight_SelectionChanged" />

            <TextBlock x:Name="tblockCrossTabVariable" Margin="0,12,0,0">One graph for each value of:</TextBlock>
            <ComboBox x:Name="cmbFieldCrosstab" Width="216" HorizontalAlignment="Left" Height="28" SelectionChanged="cmbFieldWeight_SelectionChanged" />
        </StackPanel>
<!--Display-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <StackPanel x:Name="panelDisplay" Grid.Column="2" VerticalAlignment="Stretch" Margin="0, 0, 10, 0" Visibility="Collapsed">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Display</Label>

            <ScrollViewer x:Name="scrollViewerProperties" Height="480.0">
                <StackPanel>
                    <Label Style="{StaticResource PropertiesSubHeading}" Margin="0,0, 0, 10">Title and Description</Label>
                    <Label x:Name="tblockTitle" VerticalAlignment="Bottom" HorizontalAlignment="Left" Content="Gadget title:" />
                    <TextBox x:Name="txtTitle" Width="360" HorizontalAlignment="Left"></TextBox>

                    <Label x:Name="tblockDesc" VerticalAlignment="Bottom" HorizontalAlignment="Left" Content="Gadget description:" />
                    <TextBox x:Name="txtDesc" Width="360" AcceptsReturn="True" Height="128" HorizontalAlignment="Left" TextWrapping="Wrap"></TextBox>
                    <Label Style="{StaticResource PropertiesSubHeading}" Margin="0,0, 0, 10">Dimensions</Label>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition></ColumnDefinition>
                            <ColumnDefinition Width="5"></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <StackPanel Grid.Column="0">
                            <TextBlock x:Name="tblockWidth" HorizontalAlignment="Left" TextAlignment="Center" Text="Width:" Margin="0,12,0,0"  />
                            <TextBox x:Name="txtWidth" Text="800" TextChanged="txtWidth_TextChanged" />
                        </StackPanel>

                        <StackPanel Grid.Column="2">
                            <TextBlock x:Name="tblockHeight" HorizontalAlignment="Left" TextAlignment="Center" Text="Height:" Margin="0,12,0,0"  />
                            <TextBox x:Name="txtHeight" Text="500" TextChanged="txtHeight_TextChanged" />
                        </StackPanel>
                    </Grid>
                    <Label Style="{StaticResource PropertiesSubHeading}" Margin="0, 26, 0, 10">Output Options</Label>
                    <CheckBox x:Name="checkboxAllValues" Style="{StaticResource PropertiesPanelCheckbox}" Content="Display all list values" Visibility="Visible" IsEnabled="true" />
                    <CheckBox x:Name="checkboxCommentLegalLabels" Style="{StaticResource PropertiesPanelCheckbox}" Content="Display list labels" Visibility="Visible" IsEnabled="true" />
                    <CheckBox x:Name="checkboxSortHighLow" Style="{StaticResource PropertiesPanelCheckbox}" Content="Sort high to low" HorizontalAlignment="Left" IsChecked="true"/>
                    <CheckBox x:Name="checkboxIncludeMissing" Style="{StaticResource PropertiesPanelCheckbox}" Content="Include missing values" IsChecked="True" />

                </StackPanel>
            </ScrollViewer>
        </StackPanel>
<!--Colors and Styles-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <StackPanel x:Name="panelDisplayColors" Grid.Column="2" VerticalAlignment="Stretch" Margin="0, 0, 10, 0" Visibility="Collapsed" >
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Colors and Styles</Label>
            <ScrollViewer x:Name="scrollViewerPropertiesColors" Height="480.0">
                <StackPanel>
                    <CheckBox x:Name="checkboxAnnotations" Margin="0,12,0,0" Content="Show annotations" HorizontalAlignment="Left" IsChecked="False" />
                    <CheckBox x:Name="checkboxAnnotationLabel" Margin="0,12,0,0" Content="Show annotation label" HorizontalAlignment="Left" IsChecked="False" />
                    <CheckBox x:Name="checkboxAnnotationValue" Margin="0,12,0,0" Content="Show annotation value" HorizontalAlignment="Left" IsChecked="False" />
                    <CheckBox x:Name="checkboxAnnotationPercent" Margin="0,12,0,0" Content="Show annotation percent" HorizontalAlignment="Left" IsChecked="False" />
                    <TextBlock x:Name="tblockPieChartKind" HorizontalAlignment="Left" TextAlignment="Center" Text="Chart kind:" Margin="0,12,0,0" />
                    <ComboBox x:Name="cmbChartKind" Width="140" HorizontalAlignment="Left" SelectedIndex="0">
                        <ComboBox.Items>
                            <ComboBoxItem>Pie 2D</ComboBoxItem>
                            <ComboBoxItem>Pie 3D</ComboBoxItem>
                            <ComboBoxItem>Donut 2D</ComboBoxItem>
                            <ComboBoxItem>Donut 3D</ComboBoxItem>
                        </ComboBox.Items>
                    </ComboBox>
                    <TextBlock x:Name="tblockPalette" HorizontalAlignment="Left" TextAlignment="Center" Text="Color palette:" Margin="0,12,0,0"  />
                    <ComboBox x:Name="cmbPalette" Width="216" HorizontalAlignment="Left" SelectedIndex="12">
                        <ComboBox.Items>
                            <ComboBoxItem>Atlantic</ComboBoxItem>
                            <ComboBoxItem>Breeze</ComboBoxItem>
                            <ComboBoxItem>ComponentArt</ComboBoxItem>
                            <ComboBoxItem>Deep</ComboBoxItem>
                            <ComboBoxItem>Earth</ComboBoxItem>
                            <ComboBoxItem>Evergreen</ComboBoxItem>
                            <ComboBoxItem>Heatwave</ComboBoxItem>
                            <ComboBoxItem>Montreal</ComboBoxItem>
                            <ComboBoxItem>Pastel</ComboBoxItem>
                            <ComboBoxItem>Renaissance</ComboBoxItem>
                            <ComboBoxItem>SharePoint</ComboBoxItem>
                            <ComboBoxItem>Study</ComboBoxItem>
                            <ComboBoxItem>VibrantA</ComboBoxItem>
                            <ComboBoxItem>VibrantB</ComboBoxItem>
                            <ComboBoxItem>VibrantC</ComboBoxItem>
                        </ComboBox.Items>
                    </ComboBox>
                    <TextBlock x:Name="tblockAnnotationPercent" HorizontalAlignment="Left" TextAlignment="Center" Text="Annotation percent:" Margin="0,12,0,0"  />
                    <TextBox x:Name="txtAnnotationPercent" HorizontalAlignment="Stretch" Text="20" SelectionChanged="txtAnnotationPercent_SelectionChanged" />
                </StackPanel>
            </ScrollViewer>
        </StackPanel>
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
<!--Labels-->
        <StackPanel x:Name="panelDisplayLabels" Grid.Column="2" VerticalAlignment="Stretch" Margin="0, 0, 10, 0" Visibility="Collapsed">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Labels</Label>
            <ScrollViewer x:Name="scrollViewerPropertiesLabels" Height="480.0">
                <StackPanel>

                    <TextBlock x:Name="tblockChartTitleValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Chart title:" Margin="0,12,0,0"  />
                    <TextBox x:Name="txtChartTitle" AcceptsReturn="True" TextWrapping="Wrap" HorizontalAlignment="Stretch" />

                    <TextBlock x:Name="tblockChartSubTitleValue" HorizontalAlignment="Left" TextAlignment="Center" Text="Chart subtitle:" Margin="0,12,0,0"  />
                    <TextBox x:Name="txtChartSubTitle" AcceptsReturn="True" TextWrapping="Wrap" HorizontalAlignment="Stretch" />

                </StackPanel>
            </ScrollViewer>
        </StackPanel>
<!--Legend-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <StackPanel x:Name="panelDisplayLegend" Grid.Column="2" VerticalAlignment="Stretch" Margin="0, 0, 10, 0" Visibility="Collapsed">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Legend</Label>
            <ScrollViewer x:Name="scrollViewerPropertiesLegend" Height="480.0">
                <StackPanel>
                    <CheckBox x:Name="checkboxShowLegend" Margin="0,12,0,0" Content="Show legend" HorizontalAlignment="Left" IsChecked="False" Click="checkboxShowLegend_Click" />
                    <CheckBox x:Name="checkboxShowLegendBorder" Margin="0,12,0,0" Content="Show legend border" HorizontalAlignment="Left" IsChecked="False" />
                    <CheckBox x:Name="checkboxShowVarName" Margin="0,12,0,0" Content="Show variable names" HorizontalAlignment="Left" IsChecked="False" />

                    <TextBlock x:Name="tblockLegendFontSize" HorizontalAlignment="Left" TextAlignment="Center" Text="Legend font size:" Margin="0,12,0,0"  />
                    <TextBox x:Name="txtLegendFontSize" HorizontalAlignment="Stretch" Text="12" SelectionChanged="txtLegendFontSize_SelectionChanged" />

                    <TextBlock x:Name="tblockLegendDock" HorizontalAlignment="Left" TextAlignment="Center" Text="Legend placement:" Margin="0,12,0,0"  />
                    <ComboBox x:Name="cmbLegendDock" Width="216" HorizontalAlignment="Left">
                        <ComboBox.Items>
                            <ComboBoxItem>Left</ComboBoxItem>
                            <ComboBoxItem>Right</ComboBoxItem>
                            <ComboBoxItem>Top</ComboBoxItem>
                            <ComboBoxItem>Bottom</ComboBoxItem>
                        </ComboBox.Items>
                    </ComboBox>
                </StackPanel>
            </ScrollViewer>
        </StackPanel>
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-->
        <!--Filters-->
        <StackPanel x:Name="panelFilters" Grid.Column="2"  Margin="0, 0, 10, 0" Visibility="Collapsed">
            <Label Style="{StaticResource PropertiesHeading}" Margin="0, 0, 0, 10">Data Filters</Label>
            <Label>Note: Any filters set here are applied to this gadget only.</Label>
        </StackPanel>
        <Button Style="{StaticResource CloseButtonStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="8" Click="CloseButton_Click" />

        <DockPanel Grid.ColumnSpan="3" Grid.Row="1">
            <Button x:Name="btnCancel" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="8" Width="134" Height="42" Click="btnCancel_Click">Cancel</Button>
            <Button x:Name="btnOK" DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="8" Width="134" Height="42" Click="btnOK_Click">OK</Button>
        </DockPanel>
    </Grid>
</PropertyPanels:GadgetPropertiesPanelBase>
